# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=f-scrack
pkgver=19.9a00357
pkgrel=4
pkgdesc='A single file bruteforcer supports multi-protocol.'
groups=('blackarch' 'blackarch-cracker')
arch=('any')
url='https://github.com/ysrc/F-Scrack'
license=('GPL3')
depends=('python2')
makedepends=('git')
source=("$pkgname::git+https://github.com/ysrc/F-Scrack.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1i\#!/usr/bin/python2' F-Scrack.py
}

package() {
  cd $pkgname

  install -Dm 755 F-Scrack.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

